

local mt = ac.skill['洗礼']

mt.targettype = '物体'
mt.range = 900
mt.target_data = '自己|玩家单位|联盟'
mt.missile_art = [[Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl]]
mt.model2 = [[Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl]]

function mt:on_cast_shot()
    local hero = self.owner
    local target = self.target
    local damage = hero:get('攻击') * self.data1/100
    if target:is_ally(hero) then
        target:add('生命',hero:get('攻击'))
        target:add_effect(self.missile_art,'origin'):remove()
    end
    hero:aoe_damage(target,380,damage,self,function(unit)
        unit:add_effect(self.model2):remove()
    end)
end




local mt = ac.skill['退化光环']

function mt:on_add()
    local hero = self.owner
    self:gc(hero:add('力量成长',self.data3))
    self:gc(hero:add_buff '光环'{
        model = [[war3mapImported\GlowingAura.mdl]],
        buff_name = '退化光环',
        buff_data = {data1 = self.data1,data2 = self.data2},
        area_type = 'enemy',
        aura_area = 900,
    })
end

local buff = ac.buff['退化光环']
buff.cover_type = 1
buff.cover_max = 1
buff.data1 = 0
buff.data2 = 0

function buff:on_add()
    local hero = self.owner
    self:gc(hero:add('攻击速度',-self.data1))
    self:gc(hero:add('移动速度',-self.data1))
end